const userList = [
    {key:'1',name:'张山',age:'19',address:'绵阳'},
    {key:'2',name:'王五',age:'17',address:'成都'},
    {key:'3',name:'赵三',age:'50',address:'德阳'},
    {key:'4',name:'成成',age:'6',address:'重庆'},
    {key:'5',name:'里尔',age:'19',address:'北京'},
    {key:'6',name:'托尔',age:'17',address:'西藏'},
    {key:'7',name:'爱丽丝',age:'19',address:'新疆'},
    {key:'8',name:'杰克',age:'17',address:'杭州'},
    {key:'9',name:'贾斯丁',age:'19',address:'上海'},
    {key:'10',name:'戴维斯',age:'17',address:'广州'},
]

export default function request(url,params) {
    const data = new listOptions();
    switch (url) {
        case '/user/list':
            return data.getList();
        case '/user/add':
            return data.addList(params);
        case '/user/remove':
            return data.delList(params);　
        case 'user/update':

    }
}
class listOptions{
    getList(){
        let returnData={
            state:0,
            message:'success',
            data:userList
        }
        return returnData;
    }
    addList(params){
        params.key = userList[userList.length].key+1;
        userList.push(params);
        let returnData={
            state:0,
            message:'success'
        }
        return returnData;
    }
    delList(params){

    }
}
